package cn.rkylin.oms.warehouse.stockin.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.warehouse.stockin.domain.StockInGoods;
import cn.rkylin.oms.warehouse.stockin.vo.StockInGoodsVO;

/**
 * 入库商品DAO
 * 
 * @author 齐涛
 * @version 1.0
 * @created 11-9-2017 10:51:30
 */
@Repository(value = "stockInGoodsDAO")
public class StockInGoodsDAOImpl implements StockInGoodsDAO {

    @Autowired
    protected IDataBaseFactory dao;

    /**
     * 查询入库单商品列表
     * 
     * @param stockInGoodsVO
     *            入库单商品VO
     * @return 入库单商品列表
     * @throws Exception
     *             异常
     */
    public List<StockInGoodsVO> selectStockInGoodsList(StockInGoodsVO stockInGoodsVO) throws Exception {
        return dao.findAllList("selectStockInGoodsList", stockInGoodsVO);
    }

    /**
     * 添加入库单商品
     *
     * @param stockInGoods
     *            入库单商品bean
     * @return 插入入库单商品条数
     * @throws Exception
     *             异常
     */
    public int insertStockInGoods(StockInGoods stockInGoods) throws Exception {
        return dao.insert("insertStockInGoods", stockInGoods);
    }

    /**
     * 更新入库单商品
     *
     * @param stockInGoods
     *            入库单商品bean
     * @return 更新入库单商品条数
     * @throws Exception
     *             异常
     */
    public int updateStockInGoods(StockInGoods stockInGoods) throws Exception {
        return dao.update("updateStockInGoods", stockInGoods);
    }

}
